package com.gym.demo;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class IoTest {
	public static void main(String[] args) throws IOException {
		File file = new File("D:\\guan.txt");
		FileInputStream inputStream = new FileInputStream(file);
		byte[] b = new byte[(int)file.length()];
		inputStream.read(b);
		String string = new String(b, "UTF-8");
		inputStream.close();
		System.err.println(string);
		
		FileOutputStream fileOutputStream = new FileOutputStream(file);
		String str = "啦啦啦啦德玛西亚";
		fileOutputStream.write(str.getBytes("UTF-8"));
		fileOutputStream.close();
	}
}
